import json from '@rollup/plugin-json'
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import commonjs from '@rollup/plugin-commonjs'


// 拿到 package.json
// const packageJson = require(path.resolve(pkgDir, 'package.json'))

/**
 * @typedef {import('rollup').RollupOptions} RollupOptions
 * @type { RollupOptions }
 */
const rollupOption = {
    external: ['vue'],
    plugins: [
        json(),
        nodeResolve(),
        typescript(),
        commonjs()
    ],
    input: 'src/index.ts',
    output: {
        sourcemap: false,
        format: 'es',
        file: 'dist/bundle.es.js',
    },
    
}

export default rollupOption